import request from '@/utils/request'

/**
 * 查询WebSocket日志列表（按司机）
 * @param {Object} query 查询参数
 */
export function onlineSessionKeys(query) {
  return request({
    url: "/api/websocketLog/onlineSessionKeys",
    method: "get",
    params: query,
  });
}

/**
 * 查询WebSocket在线会话列表
 * @param {Object} query 查询参数
 */
export function getOnlineSessionsList(query) {
  return request({
    url: '/api/websocketLog/onlineSessions',
    method: 'get',
    params: query
  })
}

/**
 * 删除WebSocket日志
 * @param {String|Array} ids 日志ID
 */
export function deleteWebSocketLog(ids) {
  return request({
    url: '/api/websocketLog/' + ids,
    method: 'delete'
  })
}

/**
 * 导出WebSocket日志
 * @param {Object} query 查询参数
 */
export function exportWebSocketLog(query) {
  return request({
    url: '/api/websocketLog/export',
    method: 'get',
    params: query
  })
}

/**
 * 清空WebSocket日志
 */
export function clearWebSocketLog() {
  return request({
    url: '/api/websocketLog/clear',
    method: 'delete'
  })
} 